package com.xzit;


import com.xzit.model.Team;
import com.xzit.service.TeamService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        // 获取 TeamService Bean
        TeamService teamService = (TeamService) context.getBean("teamService");

        // 创建一个新的 Team 实体并注册
//        Team team = new Team();
//        team.setName("对方队");
//        team.setAddress("西安");
//        teamService.registerTeam(team);
//        System.out.println(team.getName() + "注册成功！");

        // 删除一个球队
        if (teamService.removeTeamByName("对方队")==true)
            System.out.println("对方队删除成功！");
        else
            System.out.println("对方队不存在！");



    }
}